using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

using SalariesOverview = PHSRAG.Insight21.Agreements.SalariesOverview;

using PHSRAG.Insight21.SearchContext;

namespace PHSRAG.Insight21.Agreements.Controls
{
	/// <summary>
	/// Summary description for SalariesOverviewSearch.
	/// </summary>
	public partial class SalariesOverviewSearch : System.Web.UI.UserControl
	{

		protected void Page_Load(object sender, System.EventArgs e)
		{
			((WebControls.ExpansionToggler)expandingPanel.FindControl("expansionToggler")).HelpText = 
				InsightUtilities.Constants.SearchHelpText;
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{

		}
		#endregion
	
		#region Search

		/// <summary>
		/// Handler for the event raised by the CommonSearch control when the "Clear Selection" buttion is clicked upon.
		/// The control clears the criretria (specific to this module).
		/// Since in the page life-cycle, the Load occurs before the Clear event, we have to instigate a re-load of the
		/// data grid to refelect the fact that the search criteria has been cleared.
		/// </summary>
		/// <param name="sender">Sender of the event</param>
		/// <param name="e">Argument associated with the event</param>
		protected void OnClearSelection(object sender, CommandEventArgs e)
		{
				((SalariesOverview)(Page)).OnClearSelection(e); 
		}

		/// <summary>
		/// Event handler for the CommonSearch control.
		/// Make sure to set the class name properties on search, this is necessary to set 
		/// to check to see if user has selected Journal Entry order type,
		/// calls private LoadControl method to load information based on search filters,
		/// Collapse the Search Pannel once the information is loaded,
		/// </summary>
		/// <param name="args">Argument associated with the event (contains the search criteria dictionary)</param>
		protected void OnSearch(SearchCriteriaArgs args)
		{
			((SalariesOverview)(Page)).OnSearch(args);
		}
		#endregion
	}
}
